package com.guhus.ec.controller.seller;

import com.guhus.ec.service.seller.StoreService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class StoreController {
    @Autowired
    StoreService storeService;

    @ResponseBody
    @RequestMapping("/usernameIsExists")
    public Boolean usernameIsExists(@RequestParam String username) {
        return storeService.usernameIsExists(username) != 0;
    }

    @ResponseBody
    @RequestMapping("/storeNameIsExists")
    public Boolean storeNameIsExists(@RequestParam String storeName) {
        return storeService.storeNameIsExists(storeName) != 0;
    }
}
